<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: common_header(~{::title})">
    <title>联系人管理</title>
</head>
<body th:replace="layout :: common_body(~{::div.layui-body})">
<div class="layui-body" style="padding:15px;">

    <!-- start sp-wrapper -->
    <link rel="stylesheet" href="/sb/system.css"/>
    <div class="sp-wrapper">
        <h2 class="sp-title"><span>联系人列表</span></h2>
        <form method="get" action="/contact/contact_list">
            <div class="sp-tool">
                <span><input type="text" placeholder="客户" name="name">
                    <input type="text" placeholder="手机号码" name="mobile">
                    <input type="submit" value="搜索">
                    <i class="add" id="add" >新增联系人</i></span>
            </div>
        </form>
        <div class="sp-table">
            <table>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>ID</th>
                    <th>客户名称</th>
                    <th>分类</th>
                    <th>平台</th>
                    <th>平台ID</th>
                    <th>联系方式</th>
                    <th>地址</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="item:${lists}">
                    <td th:text="${itemStat.index+1}">1</td>
                    <td th:text="${item.id}">张三</td>
                    <td th:text="${item.name}">张三</td>
                    
                    <td >
                        <b th:if="${item.cCategory == 99 }">直播间</b>
                        <b th:if="${item.cCategory == 0 }">其他</b>
                        <b th:if="${item.cCategory == 1 }">消费者</b>
                        <b th:if="${item.cCategory == 66 }">达人</b>
                        <b th:if="${item.cCategory == 68 }">团长</b>
                        <b th:if="${item.cCategory == 77 }">供应商</b>
                    </td>
                    <td th:text="${item.place}">张三</td>
                    <td th:text="${item.userId}">

                    </td>
                    <td th:text="${item.contact}">18612348888</td>
                    <td th:text="${item.address}">18612348888</td>
                    <td th:text="${item.disable==0?'正常':'禁用'}">2018-10-20 16:43:20</td>
                    <td>
                        <i th:attr="d-name=${item.name},d-contact=${item.contact},d-cLevelName=${item.cLevelName},d-status=${item.disable},d-id=${item.getId()},d-userid=${item.getUserId()}
                        ,d-number=${item.number},d-cCategory=${item.cCategory},d-province=${item.province},d-city=${item.city},d-county=${item.county},d-address=${item.address}" class="edit">修改</i>
                        <i th:attr="data-id=${item.getId()}" class="delete">删除</i>
                        <a th:href="${'/contact/adress_list?id='+item.id}">地址管理</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="pages">
                <paging:pager th:value="${pageIndex}" th:rows="${totalSize}" th:size="${pageSize}"/>
            </div>
        </div>
    </div>



    <script type="text/javascript" src="/sb/jquery.min.js"></script>
    <script type="text/javascript" src="/sb/Tips.min.js"></script>

        <script type="text/javascript">
            var layer;
            var $;
            var windowOpen;
            layui.use(['laydate', 'jquery', 'form', 'layer'], function () {
                var laydate = layui.laydate;
                $ = layui.jquery;
                var form = layui.form;
                layer = layui.layer;
                laydate.render({
                    elem: '#date'
                });
    
    
    
                $(function () {
                    $("#add").click(function(){
                    layer.open({
                        type: 2,
                        title: '添加联系人',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['580px', '60%'],
                        content: '/contact/contact_add'
                    });
                })
                })
            });
    
        </script>
    <!-- end sp-wrapper -->

</div>
</body>
</html>
